﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas1a10
    {
		private string _sellercode;
		private string _sellername;
        private int? _status;
        private DateTime? _createdate;
		private string _bankno;
		private string _accountno;
		private string _cuser;
		private string _ctel;
		private string _email;
		private string _cfax;
		private string _caddress;
		private string _clistid;
		private string _levercode;
		private string _usercode;
		private string _listid;
		private double _startamount;
		private double _balance;
		
        /// <summary>
        /// 销售商代码
        /// </summary>
		public string Sellercode
		{
			get { return _sellercode;	 }
			set { _sellercode=value;	}
		}
        /// <summary>
        /// 销售商名称
        /// </summary>
		public string Sellername
		{
			get { return _sellername;	 }
			set { _sellername=value;	}
		}
        /// <summary>
        /// 系统状态
        /// </summary>
		public int? Status
		{
			get { return _status;	 }
			set { _status=value;	}
		}
        /// <summary>
        /// 创建日期
        /// </summary>
		public DateTime? Createdate
		{
			get { return _createdate;	 }
			set { _createdate=value;	}
		}
        /// <summary>
        /// 银行
        /// </summary>
		public string Bankno
		{
			get { return _bankno;	 }
			set { _bankno=value;	}
		}
        /// <summary>
        /// 帐号
        /// </summary>
		public string Accountno
		{
			get { return _accountno;	 }
			set { _accountno=value;	}
		}
        /// <summary>
        /// 联系人
        /// </summary>
		public string Cuser
		{
			get { return _cuser;	 }
			set { _cuser=value;	}
		}
        /// <summary>
        /// 联系电话
        /// </summary>
		public string Ctel
		{
			get { return _ctel;	 }
			set { _ctel=value;	}
		}
        /// <summary>
        /// Email
        /// </summary>
		public string Email
		{
			get { return _email;	 }
			set { _email=value;	}
		}
        /// <summary>
        /// 传真
        /// </summary>
		public string Cfax
		{
			get { return _cfax;	 }
			set { _cfax=value;	}
		}
        /// <summary>
        /// 地址
        /// </summary>
		public string Caddress
		{
			get { return _caddress;	 }
			set { _caddress=value;	}
		}
        /// <summary>
        /// 渠道主键
        /// </summary>
		public string Clistid
		{
			get { return _clistid;	 }
			set { _clistid=value;	}
		}
        /// <summary>
        /// 信用级别
        /// </summary>
		public string Levercode
		{
			get { return _levercode;	 }
			set { _levercode=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 期初余额
        /// </summary>
		public double Startamount
		{
			get { return _startamount;	 }
			set { _startamount=value;	}
		}
        /// <summary>
        /// 账户结余
        /// </summary>
		public double Balance
		{
			get { return _balance;	 }
			set { _balance=value;	}
		}
		
		public static List<Bas1a10> GetBas1a10ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas1a10> list = new List<Bas1a10>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas1a10 model = GetBas1a10ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas1a10 GetBas1a10ByDataRow(DataRow dr)
		{
			Bas1a10 model = new Bas1a10(); //实例化Bas1a10
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("sellercode")&&!(dr["sellercode"] is System.DBNull))  
				model.Sellercode = ( string)dr["sellercode"];
			if (dcc.Contains("sellername")&&!(dr["sellername"] is System.DBNull))  
				model.Sellername = ( string)dr["sellername"];
			if (dcc.Contains("status")&&!(dr["status"] is System.DBNull))  
				model.Status = ( int)dr["status"];
			if (dcc.Contains("createdate")&&!(dr["createdate"] is System.DBNull))  
				model.Createdate = ( DateTime)dr["createdate"];
			if (dcc.Contains("bankno")&&!(dr["bankno"] is System.DBNull))  
				model.Bankno = ( string)dr["bankno"];
			if (dcc.Contains("accountno")&&!(dr["accountno"] is System.DBNull))  
				model.Accountno = ( string)dr["accountno"];
			if (dcc.Contains("cuser")&&!(dr["cuser"] is System.DBNull))  
				model.Cuser = ( string)dr["cuser"];
			if (dcc.Contains("ctel")&&!(dr["ctel"] is System.DBNull))  
				model.Ctel = ( string)dr["ctel"];
			if (dcc.Contains("email")&&!(dr["email"] is System.DBNull))  
				model.Email = ( string)dr["email"];
			if (dcc.Contains("cfax")&&!(dr["cfax"] is System.DBNull))  
				model.Cfax = ( string)dr["cfax"];
			if (dcc.Contains("caddress")&&!(dr["caddress"] is System.DBNull))  
				model.Caddress = ( string)dr["caddress"];
			if (dcc.Contains("clistid")&&!(dr["clistid"] is System.DBNull))  
				model.Clistid = ( string)dr["clistid"];
			if (dcc.Contains("levercode")&&!(dr["levercode"] is System.DBNull))  
				model.Levercode = ( string)dr["levercode"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("startamount")&&!(dr["startamount"] is System.DBNull))  
				model.Startamount = Convert.ToDouble(dr["startamount"]);
			if (dcc.Contains("balance")&&!(dr["balance"] is System.DBNull))  
				model.Balance = Convert.ToDouble(dr["balance"]);
			
			return model;
		}
    }
}
